/**
 * Copyright (C) 2021 - 2031 O-Cubes Co., Ltd.
 */

/****************************************************************
 *  @file    arc.c
 *  @brief   ARC driver
 *  @version v1.0
 *  @date    30. Jan. 2024
 *  @author  prz
 ****************************************************************/
#include "error.h"
#include "arc.h"
//#include "io.h"
//#include "autoconf.h"

int32_t dw_arc_init(void)
{
	int32_t ercd = E_OK;
	DW_ARC_REG_PTR configArc;
	configArc = (DW_ARC_REG_PTR) (ARC_REG_BASE);
	
	
	configArc->cfg_wav_en	= 3; 
	configArc->cfg_high_b0	= 57986;
	configArc->cfg_high_b1	= 23424;
	configArc->cfg_high_b2	= 44862;
	configArc->cfg_high_b3	= 64618;
	configArc->cfg_high_b4	= 6129;
	configArc->cfg_high_b5	= 1011;
	configArc->cfg_high_b6	= 64457;
	configArc->cfg_high_b7	= 65188;
	configArc->cfg_low_b0	= 65188;
	configArc->cfg_low_b1	= 1078;
	configArc->cfg_low_b2	= 1011;
	configArc->cfg_low_b3	= 59406;
	configArc->cfg_low_b4	= 64618;
	configArc->cfg_low_b5	= 20673;
	configArc->cfg_low_b6	= 23424;
	configArc->cfg_low_b7	= 7549;
	configArc->decSouceSel	= 2;
	configArc->arcHalfWavNum= 16;
	configArc-> arcEnPeak	= 1;
	configArc->arcEnAverage = 1;
	configArc->arcPARThr	= 36;
	configArc->maxBit	= 5;
	configArc->cfg_adc_mux	= 1;
	configArc->cfg_adc	= 1;

	return ercd;
}


